﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GreatestCommonDiviso
{
    class Program
    {
        /// <summary>
        /// 两个数求最大公约数
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            
            Console.Write("请输入一个正整数：");
            int num1 = Convert.ToInt32(Console.ReadLine());
            Console.Write("请再输入一个正整数：");
            int num2 = Convert.ToInt32(Console.ReadLine());
            int k=Math.Min(num1,num2);
            for (int diviso = k; diviso >= 1; diviso--)
            {
                if (num1 % diviso == 0 && num2 % diviso == 0)
                {
                    Console.WriteLine($"最大公约数：{diviso}");
                    break;
                }
            }
   
          
            Console.ReadKey();
        }
    }
}
